From 670c90d285d17e4e10003b82094921240cae6e8a Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Fri, 27 Dec 2013 18:00:39 +0100 Subject: [PATCH] Throw exception when ArchivedFile::getUser() has unkown type Change-Id: I95117c5cc73d187c8c7b859b67ad6655d196d91e --- includes/filerepo/file/ArchivedFile.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/filerepo/file/ArchivedFile.php b/includes/filerepo/file/ArchivedFile.php index 012dd845e7..26699c4260 100644 --- a/includes/filerepo/file/ArchivedFile.php +++ b/includes/filerepo/file/ArchivedFile.php @@ -458,6 +458,7 @@ class ArchivedFile { * the rest of the file classes. * @param string $type 'text' or 'id' * @return int|string + * @throws MWException */ public function getUser( $type = 'text' ) { $this->load(); @@ -467,6 +468,9 @@ class ArchivedFile { } elseif ( $type == 'id' ) { return $this->user; } + + throw new MWException( "Unknown type '$type'." ); + } /** -- 2.20.1